package com.samoiloff.ui.scroll.simple {
	import com.samoiloff.framework.BaseComponent;

	import flash.display.MovieClip;
	import flash.events.Event;

	public class SimpleScroll extends BaseComponent {
		
		public function SimpleScroll(mainMc:MovieClip) {
			super(SimpleScrollModel, SimpleScrollController);
			init(mainMc);
		}
		
		private function init(mainMc:MovieClip):void {
			getModel().init(mainMc);
			//_scrollView = new ScrollView(_scrollModel, mc);
			_model.addEventListener(SimpleScrollModel.PROGRESS_CHANGED, onProgressChanged);
			//_controller = new ScrollController(_scrollModel, _scrollView);
		}
		
		private function onProgressChanged(e:Event): void {
			dispatchEvent(new Event(Event.CHANGE));
		}

		
		public function get progress():Number {
			return getModel().progress;
		}
		
		public function set progress(progress:Number):void {
			getModel().progress = progress;
		}
		
		private function getModel():SimpleScrollModel {
			return _model as SimpleScrollModel;
		}
	}
}
